package com.sophialex.health.record.ui.children;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.part.ViewPart;

import com.sophialex.health.record.Messages;
import com.sophialex.health.record.common.draw.DesignUI;
import com.sophialex.health.record.common.draw.UIFormAttachment;
import com.sophialex.health.record.common.utils.CommonUtils;
import com.sophialex.health.record.common.utils.ImageUtil;

/**
 * 婴儿期保健体检记录
 * <p>Title:Health</p>
 * <p>InfantHealthUI</p>
 * 
 * Alex May 25, 2011 2:01:01 PM create
 * @author <a href='wanghao924@126.com'>Alex</a>
 * QQ: 873987060;
 * @version 1.0
 */
public abstract class InfantHealthUI extends ViewPart {
	public static final String ID = "com.sophialex.health.record.ui.children.InfantHealthUI";

	private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());

	private Label lb_pgrq,lb_sflx,lb_yl,lb_hwhd,lb_yyzk,lb_dbcs,lb_dbxz,lb_dbys,lb_tz,lb_sc,lb_tw,lb_ql,lb_ms,lb_pf,lb_yan,lb_er,lb_yc,lb_xin,lb_fei,lb_gan,lb_pi,lb_fu;
	private Label lb_sz,lb_xz,lb_kgj,lb_wszq,lb_xhdb,lb_zz,lb_tiz,lb_sl,lb_tl,lb_yy,lb_xl,lb_lchb,lb_qt,lb_jl,lb_cl,lb_pgr;
	
	protected DateTime date_pgrq;  //评估日期
	
	protected Combo combo_type; //类型
	
	protected Text txt_yl; //实足月龄 日龄
	
	protected Combo combo_hwhd; //户外活动
	
	protected Combo combo_yyzk; //营养状况
	
	protected Text txt_dbcs; //大便次数
	
	protected Combo combo_dbxz; //大便性状
	
	protected Combo combo_dbys; //大便颜色
	
	protected Text txt_tz; //体重
	
	protected Text txt_sc; //身长
	
	protected Text txt_tw; //头尾
	
	protected Text txt_ql1; //前囟1
	
	protected Text txt_ql2; //前囟2
	
	protected Combo combo_ms; // 面色

	protected Text txt_ms; // 面色 异常
	
	protected Combo combo_yan; // 眼

	protected Text txt_yan; // 眼 异常
	
	protected Combo combo_pf; // 皮肤

	protected Text txt_pf; // 皮肤 异常
	
	protected Combo combo_er; // 耳

	protected Text txt_er; // 耳 异常
	
	protected Combo combo_yc; // 牙齿

	protected Text txt_yc; // 牙齿 异常
	
	protected Combo combo_xin; // 心

	protected Text txt_xin; // 心 异常
	
	protected Combo combo_fei; // 肺

	protected Text txt_fei; // 肺异常
	
	protected Combo combo_gan; // 肝

	protected Text txt_gan; // 肝异常
	
	protected Combo combo_pi; // 脾

	protected Text txt_pi; //  脾 异常
	
	protected Combo combo_fu; // 腹

	protected Text txt_fu; //  腹 异常
	
	protected Combo combo_sz; // 上肢

	protected Text txt_sz; // 上肢 异常
	
	protected Combo combo_xz; // 下肢

	protected Text txt_xz; // 下肢 异常
	
	protected Combo combo_kgj; // 髋关节

	protected Text txt_kgj; // 髋关节 异常
	
	protected Combo combo_wszq; // 外生殖器

	protected Text txt_wszq; // 外生殖器 异常
	
	protected Text txt_xhdb; // 血红蛋白
	
	protected Combo combo_zz; // 症状
	
	protected Combo combo_tiz; // 体征
	
	protected Combo combo_sl; // 视力

	protected Text txt_sl; // 视力 异常
	
	protected Combo combo_tl; // 听力

	protected Text txt_tl; // 听力 异常
	
	protected Combo combo_yy; // 语言/社交

	protected Text txt_yy; //  语言/社交 异常
	
	protected Combo combo_xl; // 心理行为

	protected Text txt_xl; //  心理行为  异常
	
	protected Combo combo_lcjh; // 两次评估间患病情况

	protected Text txt_qt; //  其他
	
	protected Text txt_jl; //  结论
	
	protected Text txt_cl; //  处理及指导
	
	protected Text txt_pgr; //  评估人
	
	public InfantHealthUI() {
	}

	private Composite composite_1;

	protected ToolItem toolItemEdit;

	protected ToolItem toolItemDel;

	protected ToolItem toolItemSave;

	protected ToolItem toolItemCancel;

	protected ToolItem toolItemAdd;

	protected ToolItem toolItemExit;

	protected enum InfantHealthUIState {
		ADD_VIEW, EDIT_VIEW, SHOW_VIEW;
	}

	/**
	 * Create contents of the view part.
	 * 
	 * @param parent
	 */
	@Override
	public void createPartControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);
		container.setLayout(new FormLayout());
		{
			composite_1 = new Composite(container, SWT.NONE);
			composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
			{
				FormData formData = new FormData();
				formData.height = 50;
				formData.right = new FormAttachment(100);
				formData.top = new FormAttachment(0);
				formData.left = new FormAttachment(0);
				composite_1.setLayoutData(formData);
			}
			{
				ToolBar toolBar = new ToolBar(composite_1, SWT.FLAT | SWT.NONE);
				toolBar.setBackgroundImage(ImageUtil.TBBJ);
				// {
				// toolItemAdd = new ToolItem(toolBar, SWT.NONE);
				//					toolItemAdd.setText(Messages.getString("RecordUI.0")); //$NON-NLS-1$
				// toolItemAdd.setImage(ImageUtil.add);
				// toolItemAdd.addSelectionListener(new SelectionAdapter() {
				// @Override
				// public void widgetSelected(SelectionEvent e) {
				// doAdd();
				// }
				// });
				// }
				{
					toolItemEdit = new ToolItem(toolBar, SWT.NONE);
					toolItemEdit.setText(Messages.getString("RecordUI.1")); //$NON-NLS-1$
					toolItemEdit.setImage(ImageUtil.edit);
					toolItemEdit.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doEdit();
						}
					});
				}
				{
					toolItemDel = new ToolItem(toolBar, SWT.NONE);
					toolItemDel.setText(Messages.getString("RecordUI.2")); //$NON-NLS-1$
					toolItemDel.setImage(ImageUtil.delete);
					toolItemDel.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doDel();
						}
					});
				}
				{
					@SuppressWarnings("unused")
					ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
				}
				{
					toolItemSave = new ToolItem(toolBar, SWT.NONE);
					toolItemSave.setText(Messages.getString("RecordUI.3")); //$NON-NLS-1$
					toolItemSave.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doSave();
						}
					});
					toolItemSave.setImage(ImageUtil.save);
				}

				{
					toolItemCancel = new ToolItem(toolBar, SWT.NONE);
					toolItemCancel.setText(Messages.getString("RecordUI.4")); //$NON-NLS-1$
					toolItemCancel.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doCancel();
						}
					});
					toolItemCancel.setImage(ImageUtil.cancel);
				}
				{
					toolItemExit = new ToolItem(toolBar, SWT.NONE);
					toolItemExit.setText(Messages.getString("RecordUI.6")); //$NON-NLS-1$
					toolItemExit.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doExit();
						}
					});
					toolItemExit.setImage(ImageUtil.exit);
				}
				/*
				 * { ToolItem toolItem = new ToolItem(toolBar, SWT.NONE);
				 * toolItem.setText(Messages.getString("RecordUI.5"));
				 * //$NON-NLS-1$ toolItem.setImage(ImageUtil.print);
				 * toolItem.addSelectionListener(new SelectionAdapter() {
				 * 
				 * @Override public void widgetSelected(SelectionEvent e) {
				 * doPrint(); } }); }
				 */
			}
		}

		{
			Composite composite = new Composite(container, SWT.NONE);
			{
				FormData formData = new FormData();
				formData.top = new FormAttachment(composite_1, 0);
				formData.bottom = new FormAttachment(100, -4);
				formData.right = new FormAttachment(composite_1, 0, SWT.RIGHT);
				formData.left = new FormAttachment(composite_1, 0, SWT.LEFT);
				composite.setLayout(new FillLayout(SWT.FILL));
				composite.setLayoutData(formData);

			}
			drawUI(composite);
		}
		initCombo();
		createActions();
		initializeToolBar();
		initializeMenu();

		this.setPartName(Messages.getString("InfantHealth.Title")); //$NON-NLS-1$

	}

	// 绘制界面
	private void drawUI(Composite parent) {

		ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
		toolkit.adapt(scrolledComposite);
		toolkit.paintBordersFor(scrolledComposite);
		scrolledComposite.setExpandHorizontal(true);
		scrolledComposite.setExpandVertical(true);
		
		ScrolledForm scrldfrmNewScrolledform = toolkit.createScrolledForm(scrolledComposite);
		toolkit.paintBordersFor(scrldfrmNewScrolledform);
		scrldfrmNewScrolledform.setText("   姓名：张三             个人档案编号：152877552142211");
		scrldfrmNewScrolledform.getBody().setLayout(new FormLayout());
		Label horLine =  new Label(scrldfrmNewScrolledform.getBody(), SWT.SEPARATOR | SWT.HORIZONTAL);
		FormData fd_horLine = new FormData();
		fd_horLine.top = new FormAttachment(0, 10);
		fd_horLine.left = new FormAttachment(2, 0);
		fd_horLine.right = new FormAttachment(100,-10);
		horLine.setLayoutData(fd_horLine);
		toolkit.adapt(horLine, true, true);
		
		//评估日期
		{
			lb_pgrq = toolkit.createLabel(scrldfrmNewScrolledform.getBody(), "评估日期：", SWT.NONE);
			FormData fd_label = new FormData();
			fd_label.top = new FormAttachment(0, 35);
			fd_label.left = new FormAttachment(2, 0);
			lb_pgrq.setLayoutData(fd_label);
			
				
			date_pgrq = new DateTime(scrldfrmNewScrolledform.getBody(), SWT.BORDER | SWT.DROP_DOWN);
			FormData fd_txtNewText = new FormData();
			fd_txtNewText.right = new FormAttachment(lb_pgrq, 166, SWT.RIGHT);
			fd_txtNewText.top = new FormAttachment(lb_pgrq,-8,SWT.TOP);
			fd_txtNewText.bottom = new FormAttachment(lb_pgrq,0,SWT.BOTTOM);
			fd_txtNewText.left = new FormAttachment(lb_pgrq, 6);
			date_pgrq.setLayoutData(fd_txtNewText);
			toolkit.adapt(date_pgrq, true, true);
		}
		//类型
		{
			lb_sflx = toolkit.createLabel(scrldfrmNewScrolledform.getBody(), "类型：", SWT.NONE);
			FormData fd_label_zrys = new FormData();
			fd_label_zrys.left = new FormAttachment(date_pgrq, 140);
			fd_label_zrys.top = new FormAttachment(lb_pgrq,0,SWT.TOP);
			lb_sflx.setLayoutData(fd_label_zrys);
			
			combo_type = new Combo(scrldfrmNewScrolledform.getBody(), SWT.READ_ONLY);
			FormData fd_combo = new FormData();
			fd_combo.top = new FormAttachment(date_pgrq,0,SWT.TOP);
			fd_combo.right = new FormAttachment(lb_sflx, 166, SWT.RIGHT);
			fd_combo.left = new FormAttachment(lb_sflx, 6);
			combo_type.setLayoutData(fd_combo);
			toolkit.adapt(combo_type);
			toolkit.paintBordersFor(combo_type);
		}
		
		// 体检信息及选项
		UIFormAttachment tjxxsectionUIAttachment = UIFormAttachment.getDefault(lb_pgrq,12,0,true);
		Section jbxxSection = DesignUI.drawSection(toolkit, scrldfrmNewScrolledform, tjxxsectionUIAttachment, "项目及选项");
		Composite composite_xmxx = DesignUI.drawSectionComposite(toolkit, jbxxSection);
		
		List<Control[]> oneLineList = new ArrayList<Control[]>();
		//实足月（日）龄
		{
			lb_yl = toolkit.createLabel(composite_xmxx, "实足月（日）龄：", SWT.NONE);
			txt_yl = toolkit.createText(composite_xmxx, "", SWT.NONE);
			Control[] controls = {lb_yl,txt_yl};
			oneLineList.add(controls);
		}
        //户外活动
		{
			lb_hwhd = toolkit.createLabel(composite_xmxx, "户外活动：", SWT.NONE);
			combo_hwhd = new Combo(composite_xmxx, SWT.READ_ONLY);
			Control[] controls = {lb_hwhd,combo_hwhd};
			oneLineList.add(controls);
			toolkit.adapt(combo_hwhd, true, true);
		}
        //营养状况
		{
			lb_yyzk = toolkit.createLabel(composite_xmxx, "营养状况：", SWT.NONE);
			combo_yyzk = new Combo(composite_xmxx, SWT.READ_ONLY);
			Control[] controls = {lb_yyzk,combo_yyzk};
			oneLineList.add(controls);
			toolkit.adapt(combo_yyzk, true, true);
		}
		DesignUI.drawSecionContent(composite_xmxx, oneLineList, 4, true, null);
		
		Group dbgroup = new Group(composite_xmxx, SWT.NONE);
		FormData fd_group = new FormData();
		fd_group.top = new FormAttachment(lb_yl,40,SWT.TOP);
		fd_group.left = new FormAttachment(0);
		fd_group.right = new FormAttachment(100);
		fd_group.bottom = new FormAttachment(combo_hwhd,100,SWT.BOTTOM);
		dbgroup.setLayoutData(fd_group);
		dbgroup.setText("大便");
		dbgroup.setLayout(new FormLayout());
		
		List<Control[]> dabianList = new ArrayList<Control[]>();
		//大便次数
		{
			lb_dbcs =  toolkit.createLabel(dbgroup, "         次数：", SWT.NONE);
			txt_dbcs = toolkit.createText(dbgroup, "", SWT.NONE);
			Label ci = toolkit.createLabel(dbgroup, "次/天", SWT.NONE);
			Control[] controls = {lb_dbcs,txt_dbcs};
			dabianList.add(controls);
			DesignUI.drawAddTo(txt_dbcs, ci, 2);
		}
		//大便性状
		{
			lb_dbxz =  toolkit.createLabel(dbgroup, "    性状：", SWT.NONE);
			combo_dbxz = new Combo(dbgroup, SWT.READ_ONLY);
			Control[] controls = {lb_dbxz,combo_dbxz};
			dabianList.add(controls);
		}
		//大便颜色
		{
			lb_dbys =  toolkit.createLabel(dbgroup, "    颜色：", SWT.NONE);
			combo_dbys =  new Combo(dbgroup, SWT.READ_ONLY);
			Control[] controls = {lb_dbys,combo_dbys};
			dabianList.add(controls);
		}
		DesignUI.drawSecionContent(dbgroup, dabianList, 4, true,null);
		
		List<Control[]> fyzkList = new ArrayList<Control[]>();
		Group fyzkgroup = new Group(composite_xmxx, SWT.NONE);
		FormData fyzk_group = new FormData();
		fyzk_group.top = new FormAttachment(dbgroup,100,SWT.TOP);
		fyzk_group.left = new FormAttachment(0);
		fyzk_group.right = new FormAttachment(100);
		fyzk_group.bottom = new FormAttachment(dbgroup,100,SWT.BOTTOM);
		fyzkgroup.setLayoutData(fyzk_group);
		fyzkgroup.setText("发育状况");
		fyzkgroup.setLayout(new FormLayout());
		
		//体重
		{
			lb_tz =  toolkit.createLabel(fyzkgroup, "         体重：", SWT.NONE);
			txt_tz = toolkit.createText(fyzkgroup, "", SWT.NONE);
			Control[] controls = {lb_tz,txt_tz};
			fyzkList.add(controls);
			Label ci = toolkit.createLabel(fyzkgroup, "kg", SWT.NONE);
			DesignUI.drawAddTo(txt_tz, ci, 2);
		}
		//身长
		{
			lb_sc =  toolkit.createLabel(fyzkgroup, "    身长：", SWT.NONE);
			txt_sc = toolkit.createText(fyzkgroup, "", SWT.NONE);
			Control[] controls = {lb_sc,txt_sc};
			fyzkList.add(controls);
			Label ci = toolkit.createLabel(fyzkgroup, "cm", SWT.NONE);
			DesignUI.drawAddTo(txt_sc, ci, 2);
		}
		//头围
		{
			lb_tw =  toolkit.createLabel(fyzkgroup, "    头围：", SWT.NONE);
			txt_tw = toolkit.createText(fyzkgroup, "", SWT.NONE);
			Control[] controls = {lb_tw,txt_tw};
			fyzkList.add(controls);
			Label ci = toolkit.createLabel(fyzkgroup, "cm", SWT.NONE);
			DesignUI.drawAddTo(txt_tw, ci, 2);
		}
		DesignUI.drawSecionContent(fyzkgroup, fyzkList, 4, true,null);
		
		//前囟
		{
			lb_ql =  toolkit.createLabel(fyzkgroup, "前囟：", SWT.NONE);
			txt_ql1 = toolkit.createText(fyzkgroup, "", SWT.NONE);
			Label ci = toolkit.createLabel(fyzkgroup, "×", SWT.NONE);
			txt_ql2 = toolkit.createText(fyzkgroup, "", SWT.NONE);
			
			Control[] controls = {lb_ql,txt_ql1,ci,txt_ql2};
			DesignUI.drawItem(fyzkgroup, controls, false, false,txt_tw,66);
			
			Label ci2 = toolkit.createLabel(fyzkgroup, "cm", SWT.NONE);
			DesignUI.drawAddTo(txt_ql2, ci2, 2);
		}
		
		
		List<Control[]> tgList = new ArrayList<Control[]>();
		Group tggroup = new Group(composite_xmxx, SWT.NONE);
		FormData tg_group = new FormData();
		tg_group.top = new FormAttachment(fyzkgroup,100,SWT.TOP);
		tg_group.left = new FormAttachment(0);
		tg_group.right = new FormAttachment(100);
		tg_group.bottom = new FormAttachment(fyzkgroup,220,SWT.BOTTOM);
		tggroup.setLayoutData(tg_group);
		tggroup.setText("体格和实验室检查");
		tggroup.setLayout(new FormLayout());
		// 面色
		{
			lb_ms = toolkit.createLabel(tggroup, "         面色：", SWT.NONE);
			combo_ms = new Combo(tggroup, SWT.READ_ONLY);
			txt_ms = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_ms, combo_ms, txt_ms };
			tgList.add(controls);
		}
		// 皮肤
		{
			lb_pf = toolkit.createLabel(tggroup, "     皮肤：", SWT.NONE);
			combo_pf = new Combo(tggroup, SWT.READ_ONLY);
			txt_pf = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_pf, combo_pf, txt_pf };
			tgList.add(controls);
		}
		// 眼
		{
			lb_yan = toolkit.createLabel(tggroup, "      眼：", SWT.NONE);
			combo_yan = new Combo(tggroup, SWT.READ_ONLY);
			txt_yan = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_yan, combo_yan, txt_yan };
			tgList.add(controls);
		}
		// 耳
		{
			lb_er = toolkit.createLabel(tggroup, "   耳：", SWT.NONE);
			combo_er = new Combo(tggroup, SWT.READ_ONLY);
			txt_er = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_er, combo_er, txt_er };
			tgList.add(controls);
		}
		// 牙齿
		{
			lb_yc = toolkit.createLabel(tggroup, "牙齿：", SWT.NONE);
			combo_yc = new Combo(tggroup, SWT.READ_ONLY);
			txt_yc = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_yc, combo_yc, txt_yc };
			tgList.add(controls);
		}
		// 心
		{
			lb_xin = toolkit.createLabel(tggroup, "心：", SWT.NONE);
			combo_xin = new Combo(tggroup, SWT.READ_ONLY);
			txt_xin = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_xin, combo_xin, txt_xin };
			tgList.add(controls);
		}
		// 肺
		{
			lb_fei = toolkit.createLabel(tggroup, "肺：", SWT.NONE);
			combo_fei = new Combo(tggroup, SWT.READ_ONLY);
			txt_fei = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_fei, combo_fei, txt_fei };
			tgList.add(controls);
		}
		//肝
		{
			lb_gan = toolkit.createLabel(tggroup, "肝：", SWT.NONE);
			combo_gan = new Combo(tggroup, SWT.READ_ONLY);
			txt_gan = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_gan, combo_gan, txt_gan };
			tgList.add(controls);
		}
		//脾
		{
			lb_pi = toolkit.createLabel(tggroup, "脾：", SWT.NONE);
			combo_pi = new Combo(tggroup, SWT.READ_ONLY);
			txt_pi = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_pi, combo_pi, txt_pi };
			tgList.add(controls);
		}
		//腹
		{
			lb_fu = toolkit.createLabel(tggroup, "腹：", SWT.NONE);
			combo_fu = new Combo(tggroup, SWT.READ_ONLY);
			txt_fu = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_fu, combo_fu, txt_fu };
			tgList.add(controls);
		}
		//上肢
		{
			lb_sz = toolkit.createLabel(tggroup, "上肢：", SWT.NONE);
			combo_sz = new Combo(tggroup, SWT.READ_ONLY);
			txt_sz = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_sz, combo_sz, txt_sz };
			tgList.add(controls);
		}
		//下肢
		{
			lb_xz = toolkit.createLabel(tggroup, "下肢：", SWT.NONE);
			combo_xz = new Combo(tggroup, SWT.READ_ONLY);
			txt_xz = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_xz, combo_xz, txt_xz };
			tgList.add(controls);
		}
		//外生殖器
		{
			lb_wszq = toolkit.createLabel(tggroup, "外生殖器：", SWT.NONE);
			combo_wszq = new Combo(tggroup, SWT.READ_ONLY);
			txt_wszq = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_wszq, combo_wszq, txt_wszq };
			tgList.add(controls);
		}
		//髋关节
		{
			lb_kgj = toolkit.createLabel(tggroup, "髋关节：", SWT.NONE);
			combo_kgj = new Combo(tggroup, SWT.READ_ONLY);
			txt_kgj = toolkit.createText(tggroup, "", SWT.NONE);
			Control[] controls = { lb_kgj, combo_kgj, txt_kgj };
			tgList.add(controls);
		}
		//血红蛋白
		{
			lb_xhdb = toolkit.createLabel(tggroup, "血红蛋白：", SWT.NONE);
			txt_xhdb = toolkit.createText(tggroup, "", SWT.NONE);
			Label lb_pix = toolkit.createLabel(tggroup, "(g/L)", SWT.NONE);
			Control[] controls = { lb_xhdb, txt_xhdb, lb_pix };
			tgList.add(controls);
		}
		DesignUI.defaultWidth = 80;
		DesignUI.drawSecionContent(tggroup, tgList, 4, true, null);
		DesignUI.reset();
		
		List<Control[]> glbList = new ArrayList<Control[]>();
		Group glbgroup = new Group(composite_xmxx, SWT.NONE);
		FormData glb_group = new FormData();
		glb_group.top = new FormAttachment(tggroup,220,SWT.TOP);
		glb_group.left = new FormAttachment(0);
		glb_group.right = new FormAttachment(100);
		glb_group.bottom = new FormAttachment(tggroup,90,SWT.BOTTOM);
		glbgroup.setLayoutData(glb_group);
		glbgroup.setText("佝偻病");
		glbgroup.setLayout(new FormLayout());
		
		//症状
		{
			lb_zz = toolkit.createLabel(glbgroup, "         症状：", SWT.NONE);
			combo_zz = new Combo(glbgroup, SWT.READ_ONLY);
			Control[] controls = { lb_zz, combo_zz};
			glbList.add(controls);
		}
		//体征
		{
			lb_tiz = toolkit.createLabel(glbgroup, "    体征：", SWT.NONE);
			combo_tiz = new Combo(glbgroup, SWT.READ_ONLY);
			Control[] controls = { lb_tiz, combo_tiz};
			glbList.add(controls);
		}
		DesignUI.drawSecionContent(glbgroup, glbList, 4, true, null);
		
		List<Control[]> fypgList = new ArrayList<Control[]>();
		Group fypggroup = new Group(composite_xmxx, SWT.NONE);
		FormData fypg_group = new FormData();
		fypg_group.top = new FormAttachment(glbgroup,80,SWT.TOP);
		fypg_group.left = new FormAttachment(0);
		fypg_group.right = new FormAttachment(100);
		fypg_group.bottom = new FormAttachment(glbgroup,90,SWT.BOTTOM);
		fypggroup.setLayoutData(fypg_group);
		fypggroup.setText("发育评估");
		fypggroup.setLayout(new FormLayout());
		
		// 视力
		{
			lb_sl = toolkit.createLabel(fypggroup, "         视力：", SWT.NONE);
			combo_sl = new Combo(fypggroup, SWT.READ_ONLY);
			txt_sl = toolkit.createText(fypggroup, "", SWT.NONE);
			Control[] controls = { lb_sl, combo_sl, txt_sl };
			fypgList.add(controls);
		}
		// 听力
		{
			lb_tl = toolkit.createLabel(fypggroup, "     听力：", SWT.NONE);
			combo_tl = new Combo(fypggroup, SWT.READ_ONLY);
			txt_tl = toolkit.createText(fypggroup, "", SWT.NONE);
			Control[] controls = { lb_tl, combo_tl, txt_tl };
			fypgList.add(controls);
		}
		// 语言/社交
		{
			lb_yy = toolkit.createLabel(fypggroup, "语言/社交：", SWT.NONE);
			combo_yy = new Combo(fypggroup, SWT.READ_ONLY);
			txt_yy = toolkit.createText(fypggroup, "", SWT.NONE);
			Control[] controls = { lb_yy, combo_yy, txt_yy };
			fypgList.add(controls);
		}
		// 心理行为
		{
			lb_xl = toolkit.createLabel(fypggroup, "心理行为：", SWT.NONE);
			combo_xl = new Combo(fypggroup, SWT.READ_ONLY);
			txt_xl = toolkit.createText(fypggroup, "", SWT.NONE);
			Control[] controls = { lb_xl, combo_xl, txt_xl };
			fypgList.add(controls);
		}
		DesignUI.defaultWidth = 80;
		DesignUI.drawSecionContent(fypggroup, fypgList, 4, true, null);
		DesignUI.reset();
		
		
		List<Control[]> qtList = new ArrayList<Control[]>();
		Group qtgroup = new Group(composite_xmxx, SWT.NONE);
		FormData qt_group = new FormData();
		qt_group.top = new FormAttachment(fypggroup,80,SWT.TOP);
		qt_group.left = new FormAttachment(0);
		qt_group.right = new FormAttachment(100);
		qt_group.bottom = new FormAttachment(fypggroup,200,SWT.BOTTOM);
		qtgroup.setLayoutData(qt_group);
		qtgroup.setText("其他");
		qtgroup.setLayout(new FormLayout());			
		//两次评估间患病情况
		{
			lb_lchb = toolkit.createLabel(qtgroup, "          两次评估间患病情况：", SWT.NONE);
			combo_lcjh = new Combo(qtgroup, SWT.READ_ONLY);
			Control[] controls = { lb_lchb, combo_lcjh};
			qtList.add(controls);
		}
		//其他
		{
			lb_qt = toolkit.createLabel(qtgroup, "其他：", SWT.NONE);
			txt_qt = toolkit.createText(qtgroup, "", SWT.NONE);
			Control[] controls = { lb_qt, txt_qt};
			qtList.add(controls);
		}
		//结论
		{
			lb_jl = toolkit.createLabel(qtgroup, "结论：", SWT.NONE);
			txt_jl = toolkit.createText(qtgroup, "", SWT.NONE);
			Control[] controls = { lb_jl, txt_jl};
			qtList.add(controls);
		}
		DesignUI.drawSecionContent(qtgroup, qtList, 4, true, null);
		
		//处理及指导
		{
			lb_cl = toolkit.createLabel(qtgroup, "处理及指导：", SWT.NONE);
			FormData fd_cl = new FormData();
			fd_cl.top = new FormAttachment(lb_lchb,40,SWT.TOP);
			fd_cl.right = new FormAttachment(lb_lchb,0,SWT.RIGHT);
			lb_cl.setLayoutData(fd_cl);
			
			txt_cl =  toolkit.createText(qtgroup, "", SWT.WRAP|SWT.MULTI|SWT.V_SCROLL);
			FormData fd_txt_cl = new FormData();
			fd_txt_cl.right = new FormAttachment(txt_qt, 0, SWT.RIGHT);
			fd_txt_cl.top = new FormAttachment(lb_cl,0, SWT.TOP);
			fd_txt_cl.bottom = new FormAttachment(lb_cl,60,SWT.BOTTOM);
			fd_txt_cl.left = new FormAttachment(lb_cl, 6);
			txt_cl.setLayoutData(fd_txt_cl);
		}
		// 评估人
		{
			lb_pgr = toolkit.createLabel(qtgroup, "评估人：", SWT.NONE);
			FormData fd_pgr = new FormData();
			fd_pgr.top = new FormAttachment(lb_cl,0,SWT.TOP);
			fd_pgr.right = new FormAttachment(lb_jl,0,SWT.RIGHT);
			lb_pgr.setLayoutData(fd_pgr);
			txt_pgr = toolkit.createText(qtgroup, "", SWT.NONE);
			FormData fd_txt_pgr = new FormData();
			fd_txt_pgr.right = new FormAttachment(lb_pgr, 166, SWT.RIGHT);
			fd_txt_pgr.top = new FormAttachment(lb_pgr, -8, SWT.TOP);
			fd_txt_pgr.bottom = new FormAttachment(lb_pgr,0,SWT.BOTTOM);
			fd_txt_pgr.left = new FormAttachment(lb_pgr, 6);
			txt_pgr.setLayoutData(fd_txt_pgr);
		}
		scrolledComposite.setContent(scrldfrmNewScrolledform);
		scrolledComposite.setMinSize(scrldfrmNewScrolledform.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		

	}

	protected void doExport() {

	}

	protected void doExit() {
		getViewSite().getPage().hideView(this);
	}

	protected abstract void doCancel();

	protected abstract void doSave();

	protected abstract void doDel();

	protected abstract void doEdit();

	protected abstract void doAdd();

	protected abstract void doPrint();

	/**
	 * Create the actions.
	 */
	private void createActions() {

	}

	/**
	 * Initialize the toolbar.
	 */
	private void initializeToolBar() {
		@SuppressWarnings("unused")
		IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
	}

	/**
	 * Initialize the menu.
	 */
	private void initializeMenu() {
		@SuppressWarnings("unused")
		IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
	}

	public void initCombo() {
		
		CommonUtils.initCombo(combo_type, "YESFLX");
		CommonUtils.initCombo(combo_hwhd, "YEHWHD");
		CommonUtils.initCombo(combo_dbxz, "DBXZ");
		CommonUtils.initCombo(combo_dbys, "DBYS");
		CommonUtils.initCombo(combo_yyzk, "YYZK");
		
		CommonUtils.initCombo(combo_ms, "ZCYC");
		CommonUtils.initCombo(combo_yan, "ZCYC");
		CommonUtils.initCombo(combo_sz, "ZCYC");
		CommonUtils.initCombo(combo_er, "ZCYC");
		CommonUtils.initCombo(combo_xz, "ZCYC");
		CommonUtils.initCombo(combo_pf, "ZCYC");

		CommonUtils.initCombo(combo_wszq, "ZCYC");
		CommonUtils.initCombo(combo_kgj, "ZCYC");
		CommonUtils.initCombo(combo_fei, "ZCYC");
		CommonUtils.initCombo(combo_yc, "ZCYC");
		CommonUtils.initCombo(combo_xin, "ZCYC");
		CommonUtils.initCombo(combo_fei, "ZCYC");
		CommonUtils.initCombo(combo_gan, "ZCYC");
		CommonUtils.initCombo(combo_pi, "ZCYC");
		
		CommonUtils.initCombo(combo_sl, "ZCYC");
		CommonUtils.initCombo(combo_tl, "ZCYC");
		CommonUtils.initCombo(combo_yy, "ZCYC");
		CommonUtils.initCombo(combo_xl, "ZCYC");
		CommonUtils.initCombo(combo_fu, "ZCYC");
		
		CommonUtils.initCombo(combo_zz, "ZHZ");
		CommonUtils.initCombo(combo_tiz, "TIZ");
		CommonUtils.initCombo(combo_lcjh, "YOUWU");
	}

}
